home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / poly3d-h / program.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  2.5 KB  |  80 lines

  1. /*****************************************************************************
  2. * Definitions for the Poly3D-H program:                                      *
  3. *****************************************************************************/
  4.  
  5. #ifndef POLY_3D_H_H
  6. #define POLY_3D_H_H
  7.  
  8. #include "irit_sm.h"
  9. #include "genmat.h"
  10. #include "iritprsr.h"
  11. #include "iritgrap.h"
  12. #include "attribut.h"
  13. #include "allocate.h"
  14. #include "cagd_lib.h"
  15.  
  16. #ifdef  EPSILON
  17. #undef  EPSILON
  18. #endif  /* EPSILON */
  19. #define EPSILON    1e-4  /* Make it smaller if you changed to double precision. */
  20.  
  21. #define  EDGE_HASH_TABLE_SIZE    500 /* Number of entries in edge hash table. */
  22. #define  EDGE_HASH_TABLE_SIZE1    499             /* One below the above. */
  23. #define  EDGE_HASH_TABLE_SIZE2    250               /* Half of above. */
  24. #define  POLY_HASH_TABLE_SIZE    500 /* Number of entries in poly hash table. */
  25. #define  POLY_HASH_TABLE_SIZE1    499             /* One below the above. */
  26. #define  POLY_HASH_TABLE_SIZE2    250               /* Half of above. */
  27.  
  28. #define  VISIBLE_COLOR    IG_IRIT_YELLOW /* Color to draw visible line result. */
  29. #define  HIDDEN_COLOR    IG_IRIT_BLUE    /* Color to draw hidden line result. */
  30. #define  HIDDEN_COLOR_RATIO    2         /* Color to dim visible RGB color. */
  31.  
  32. #define  VISIBLE_WIDTH        0.05
  33. #define  HIDDEN_WIDTH_RATIO    10
  34.  
  35. #define  DEFAULT_FINENESS    4      /* Default fineness of srf subdiv. */
  36.  
  37. typedef struct EdgeStruct {
  38.     struct EdgeStruct *Pnext;
  39.     IPVertexStruct *Vertex[2];               /* The two edge vertices. */
  40.     unsigned char Internal;           /* If edge is Internal (IRIT output). */
  41. } EdgeStruct;
  42.  
  43. /* The following are global setable variables (via config file poly3d-h.cfg) */
  44. extern int
  45.     GlblMore,
  46.     GlblClipScreen,
  47.     GlblQuiet,
  48.     GlblOutputHasRGB,
  49.     GlblOutputRGB[3],
  50.     GlblOutputColor,
  51.     GlblNumEdge,
  52.     GlblBackFacing,
  53.     GlblInternal,
  54.     GlblOutputHiddenData,
  55.     NumOfPolygons;              /* Total number of polygons to handle. */
  56.  
  57. extern RealType
  58.     GlblOutputWidth;
  59.  
  60. /* Global transformation matrix: */
  61. extern MatrixType
  62.     GlblViewMat;               /* Current view/persp. of object. */
  63.  
  64. /* Data structures used by the hidden line modules: */
  65. extern int EdgeCount;
  66. extern EdgeStruct *EdgeHashTable[];
  67. extern IPPolygonStruct *PolyHashTable[];
  68.  
  69. /* And finally the prototypes of the Poly3D-H.c module: */
  70. void Poly3dhExit(int ExitCode);
  71.  
  72. /* Prototypes of the PrepData.c module: */
  73. void PrepareViewData(IPObjectStruct *Objects);
  74. int CrossProd(RealType Pt1[3], RealType Pt2[3], RealType Pt3[3]);
  75.  
  76. /* Prototypes of the Out-Edge.c module: */
  77. void OutVisibleEdges(FILE *OutFile);
  78.  
  79. #endif /* POLY_3D_H_H */
  80.